package mgt.pages

class ApiAuthShowPage extends geb.Page {
    static url = "/apiAuth/show"

    static content = {
        propertyList(wait: true) { $(".property-list") }
        appNameValue { propertyList.find('aria-labelledby': 'name-label') }
        clientIdValue { propertyList.find('aria-labelledby': 'clientId-label') }
        clientSecretValue { propertyList.find('aria-labelledby': 'clientSecret-label') }
        apiDefinitionsList { propertyList.find('aria-labelledby': 'apiDefinitions-label').find("li") }
    }

    String getAppName() {
        return appNameValue.text()
    }

    String getClientId() {
        clientIdValue.text()
    }

    String getClientSecret() {
        clientSecretValue.text()
    }

    Integer getApiDefinitionsCount() {
        apiDefinitionsList.size()
    }
}